package com.yenlien.traceyun.business.entity;


import lombok.Data;

import javax.persistence.*;

/**
 * 产销对接
 */
@Data
@Entity
@Table(name = "t_product_dock")
public class ProductDock extends TraceEntity {
    @Column
    private String title; //产品标题
    @Column
    private String img; //产品图片
    @Column
    private String relatedProducts; //关联产品
    @Column
    private String quality; //保质期
    @Column
    private String link; //电商链接
    // @Column
    private String price; //产品价格

    private String origin; //产地

    private String contactName; //联系人姓名

    private String concatPhone; //联系人电话号码
    @Column
    @Lob
    private String introduce; //介绍
    @Transient
    private String query; //查询字段


    public void setImg(String originalFilename, String newName) throws IllegalAccessException {
        if (this.getImg() != null && this.getImg().contains(originalFilename)) {
            this.setImg(this.getImg().replace(originalFilename, newName));
        }
    }

}
